#!usr/bin/env python
# -*- coding:utf-8 _*-
"""
@author:robot
@file: db_info_cloud.py
@version:
@time: 2022/02/28
"""
SOURCE = {'connection_type': 'source'}
TARGET = {'connection_type': 'target'}
SOURCE_AND_TARGET = {'connection_type': 'source_and_target'}
test_server001 = '192.168.0.28'
test_server002 = '192.168.0.18'
test_server003 = '192.168.0.33'
test_server004 = '192.168.0.25'
user_root = 'root'
user_sa = 'sa'
user_ora = 'c##tapdata'
password = 'Gotapd8#'
# port
mongodb_port = '24212'
source = 'source'
target = 'target'
source_and_target = 'source_and_target'
source_db = 'source'
target_db = 'target'
source_and_target_db = 'source_and_target'

__all__ = [
    # yun
    'Mysql',
    'Oracle',
    'MongoDB',
    'Postgres',
    'Sqlserver',
    'ES',
    # local
    # target
    'OceanBase',
    'Doris',
    'ClickHouse',
    'Gbase8a',
    'Gbase8s',
    'Redis',
    'Hive',
    # source and target
    'ActiveMQ',
    'RabbitMQ',
    'RocketMQ',
    'Kafka',

    'DB2',
    'Mariadb',
    'Dummy',

    'DM',
    'KingBaseR3',
    'KingBaseR6',
    'TiDB'
]


class DM:
    database_type = 'Dameng'

    AUTO_DM_DBA = {
        "name": "AUTO_DM_DBA",
        "database_type": database_type,
        "connection_type": target,
        "database_host": "192.168.1.183",
        "database_port": "52360",
        "database_name": "SYSDBA",
        "database_owner": "SYSDBA ",
        "database_username": "sysdba",
        "plain_password": "Gotapd8!",
        "config": {
            "database": "SYSDBA",
            "host": "192.168.1.183",
            "port": 52360,
            "timezone": "",
            "user": "sysdba",
            "password": 'Gotapd8!'
        }
    }

    AUTO_DM_SOURCE = {
        "name": "AUTO_DM_SOURCE",
        "database_type": database_type,
        "connection_type": target,
        "database_host": "192.168.1.183",
        "database_port": "52360",
        "database_name": "SOURCE",
        "database_owner": "SOURCE ",
        "database_username": "SOURCE",
        "plain_password": "Gotapd888",
        "config": {
            "database": "SOURCE",
            "host": "192.168.1.183",
            "port": 52360,
            "timezone": "",
            "user": "SOURCE",
            "password": 'Gotapd888'
        }
    }

    AUTO_DM_TARGET = {
        "name": "AUTO_DM_TARGET",
        "database_type": database_type,
        "connection_type": target,
        "database_host": "192.168.1.183",
        "database_port": "52360",
        "database_name": "TARGET",
        "database_owner": "TARGET ",
        "database_username": "target",
        "plain_password": "Gotapd888",
        "config": {
            "database": "TARGET",
            "host": "192.168.1.183",
            "port": 52360,
            "timezone": "",
            "user": "TARGET",
            "password": 'Gotapd888'
        }
    }


class KingBaseR3:
    database_type = 'KingBaseES-R3'
    AUTO_KingBaseR3_SOURCE = {
        "name": "AUTO_KingBaseR3_SOURCE",
        "database_type": database_type,
        "connection_type": source,
        "database_host": "192.168.1.189",
        "database_port": "54321",
        "database_name": "SOURCE",
        "database_owner": "PUBLIC",
        "database_username": "SYSTEM",
        "plain_password": "123456",
        "config": {
            'database': 'SOURCE',
            'host': '192.168.1.189',
            'port': 54321,
            'user': 'SYSTEM',
            'schema': 'PUBLIC',
            'password': '123456',
            'logPluginName': 'wal2json'
        }
    }

    AUTO_KingBaseR3_TARGET = {
        "name": "AUTO_KingBaseR3_TARGET",
        "database_type": database_type,
        "connection_type": target,
        "database_host": "192.168.1.189",
        "database_port": "54321",
        "database_name": "TARGET",
        "database_owner": "PUBLIC",
        "database_username": "SYSTEM",
        "plain_password": "123456",
        "config": {
            'database': 'TARGET',
            'host': '192.168.1.189',
            'port': 54321,
            'user': 'SYSTEM',
            'schema': 'PUBLIC',
            'password': '123456',
            'logPluginName': 'wal2json'
        }
    }


class KingBaseR6:
    database_type = 'KingBaseES-R6'
    AUTO_KingBaseR6_SOURCE = {
        "name": "AUTO_KingBaseR6_SOURCE",
        "database_type": database_type,
        "connection_type": source,
        "database_host": "192.168.1.189",
        "database_port": "54322",
        "database_name": "source",
        "database_owner": "public",
        "database_username": "system",
        "plain_password": "123456",
        "config": {
            'database': 'source',
            'host': '192.168.1.189',
            'port': 54322,
            'user': 'system',
            'schema': 'public',
            'password': '123456',
            'logPluginName': 'wal2json'
        }
    }

    AUTO_KingBaseR6_TARGET = {
        "name": "AUTO_KingBaseR6_TARGET",
        "database_type": database_type,
        "connection_type": target,
        "database_host": "192.168.1.189",
        "database_port": "54322",
        "database_name": "target",
        "database_owner": "public",
        "database_username": "system",
        "plain_password": "123456",
        "config": {
            'database': 'target',
            'host': '192.168.1.189',
            'port': 54322,
            'user': 'system',
            'schema': 'public',
            'password': '123456',
            'logPluginName': 'wal2json'
        }
    }


class Mariadb:
    database_type = 'Mariadb'

    AUTO_MARIADB_SOURCE = {
        "name": "AUTO_MARIADB_SOURCE",
        "database_type": database_type,
        "database_host": "192.168.1.183",
        "database_port": "43061",
        "database_name": source_db,
        "database_username": "root",
        "plain_password": "Gotapd8#",
        "connection_type": source,
        "config": {
            "host": "192.168.1.183",
            "port": 43061,
            "timezone": "Database Timezone",
            "database": source_db,
            "username": "root",
            "password": "Gotapd8#"
        },
    }

    AUTO_MARIADB_TARGET = {
        "name": "AUTO_MARIADB_TARGET",
        "database_type": database_type,
        "database_host": "192.168.1.183",
        "database_port": "43061",
        "database_name": target_db,
        "database_username": "root",
        "plain_password": "Gotapd8#",
        "connection_type": target,
        "config": {
            "host": "192.168.1.183",
            "port": 43061,
            "timezone": "Database Timezone",
            "database": target_db,
            "username": "root",
            "password": "Gotapd8#"
        },
    }


class Hive:
    database_type = 'hive1'

    AUTO_HIVE_TARGET = {
        "name": "AUTO_HIVE_TARGET",
        "database_type": database_type,
        "connection_type": target,
        "database_host": "192.168.1.179",
        'python_port': '10000',
        "database_port": "10000",
        "database_name": "default",
        "database_username": "default",
        "config": {
            'database': 'default',
            'host': '192.168.1.179',
            'port': 10000,
            'timezone': "",
            'user': "default"
        }
    }


class Gbase8a:
    database_type = 'GBase-8a'

    AUTO_Gbase8a = {
        "name": "AUTO_Gbase8a",
        "database_type": database_type,
        "database_host": "192.168.1.189",
        "database_port": "5258",
        "database_name": "target",
        "database_username": "root",
        "plain_password": "root",
        "connection_type": target,
        "config": {
            "host": "192.168.1.189",
            "port": 5258,
            "timezone": "",
            "database": "target",
            "user": "root",
            "password": "root",
            "extParams": "",
        }
    }


class Gbase8s:
    database_type = 'GBase-8s'

    AUTO_Gbase8s = {
        "name": "AUTO_Gbase8s",
        "database_type": database_type,
        "database_host": "192.168.1.189",
        "database_port": "9088",
        "database_name": "testdb",
        "database_username": "gbasedbt",
        "plain_password": "GBase123",
        "connection_type": target,
        "config": {
            "host": "192.168.1.189",
            "port": 9088,
            "timezone": "",
            "database": "testdb",
            "schema": 'testdb',
            "user": "gbasedbt",
            "password": "GBase123",
            "extParams": ":delimident=y",
        }
    }


class ActiveMQ:
    database_type = 'ActiveMQ'
    AUTO_ACTIVEMQ_SOURCE = {
        "name": "AUTO_ACTIVEMQ_SOURCE",
        'database_type': database_type,
        'connection_type': source,
        'mqType': '0',
        'brokerURL': 'tcp://192.168.1.183:61616',
        'pythonURL': 'tcp://192.168.1.183:61613',
        'mqUserName': 'admin',
        'mqPassword': 'admin',
        "config": {
            'brokerURL': 'tcp://192.168.1.183:61616',
            'mqPassword': 'admin',
            'mqUsername': 'admin',
            # 'mqQueueString': '',
        },
        'pdk': True
    }
    AUTO_ACTIVEMQ_TARGET = {
        "name": "AUTO_ACTIVEMQ_TARGET",
        'database_type': database_type,
        'connection_type': target,
        'mqType': '0',
        'brokerURL': 'tcp://192.168.1.183:61616',
        'pythonURL': 'tcp://192.168.1.183:61613',
        'mqUserName': 'admin',
        'mqPassword': 'admin',
        "config": {
            'brokerURL': 'tcp://192.168.1.183:61616',
            'mqPassword': 'admin',
            'mqUsername': 'admin',
            # 'mqQueueString': '',
        },
        'pdk': True
    }


class RabbitMQ:
    database_type = 'RabbitMQ'

    AUTO_RABBITMQ_SOURCE = {
        'name': 'AUTO_RABBITMQ_SOURCE',
        'database_type': database_type,
        'connection_type': source,
        'database_host': '192.168.1.183',
        'database_port': '15674',
        'mqUserName': 'admin',
        'mqPassword': 'admin',
        'virtualHost': "/",
        'config': {
            'apiPort': 8090,
            'mqHost': '192.168.1.183',
            'mqPort': 15674,
            'mqUsername': 'admin',
            'mqPassword': 'admin',
            'virtualHost': '/'
        },
        'pdk': True
    }

    AUTO_RABBITMQ_TARGET = {
        'name': 'AUTO_RABBITMQ_TARGET',
        'database_type': database_type,
        'connection_type': target,
        'database_host': '192.168.1.183',
        'database_port': '15674',
        'mqUserName': 'admin',
        'mqPassword': 'admin',
        'virtualHost': "/",
        'config': {
            'apiPort': 8090,
            'mqHost': '192.168.1.183',
            'mqPort': 15674,
            'mqUsername': 'admin',
            'mqPassword': 'admin',
            'virtualHost': '/'
        },
        'pdk': True
    }


class RocketMQ:
    database_type = 'RocketMQ'
    AUTO_ROCKETMQ_SOURCE = {
        'name': 'AUTO_ROCKETMQ_SOURCE',
        'database_type': database_type,
        'connection_type': source,
        'host': '192.168.1.189',
        'port': '9876',
        'mqUserName': '',
        'mqPassword': '',
        'config': {
            'mqHost': '192.168.1.189',
            'mqPort': 9876,
            'producerGroup': 'tapdata',
            'consumerGroup': 'tapdata',
            'useTLS': False
        },
        'pdk': True
    }

    AUTO_ROCKETMQ_TARGET = {
        'name': 'AUTO_ROCKETMQ_TARGET',
        'database_type': database_type,
        'connection_type': target,
        'host': '192.168.1.126',
        'port': '9876',
        'mqUserName': '',
        'mqPassword': '',
        'config': {
            'mqHost': '192.168.1.126',
            'mqPort': 9876,
            'producerGroup': 'tapdata',
            'consumerGroup': 'tapdata',
            'useTLS': False
        },
        'pdk': True
    }


class Mysql:
    database_type = {'database_type': 'Mysql'}
    auto_mysql_source = {
        "name": "auto_mysql_source",
        **database_type,
        "database_host": "47.115.163.10",
        "database_port": "3306",
        "database_name": "source",
        "database_username": "root",
        "plain_password": "zsj@520wm",
        "connection_type": source_and_target,
        "config": {
            "host": "47.115.163.10",
            "port": 3306,
            "timezone": "Database Timezone",
            "database": "source",
            "username": "root",
            "password": "zsj@520wm"
        }
    }

    Auto_Test001Mysql = {
        'name': 'Auto_Test001Mysql',
        'database_host': test_server001,
        'database_port': '33064',
        'database_name': 'INSURANCE',
        'database_username': user_root,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        "config": {
            "host": test_server001,
            "port": 33064,
            "timezone": "Database Timezone",
            "database": "INSURANCE",
            "username": user_root,
            "password": password
        }
    }

    Auto_Test002Mysql = {
        'name': 'Auto_Test002Mysql',
        'database_host': test_server002,
        'database_port': '33064',
        'database_name': 'INSURANCE',
        'database_username': user_root,
        'plain_password': password,
        'serve': {
            'docker': 'c275f6f0d8ea'
        },
        **SOURCE_AND_TARGET,
        **database_type,
        "config": {
            "host": test_server002,
            "port": 33064,
            "timezone": "Database Timezone",
            "database": "INSURANCE",
            "username": user_root,
            "password": password
        }
    }

    Auto_Test003Mysql = {
        'name': 'Auto_Test003Mysql',
        'database_host': test_server003,
        'database_port': '33064',
        'database_name': 'INSURANCE',
        'database_username': user_root,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        "config": {
            "host": test_server003,
            "port": 33064,
            "timezone": "Database Timezone",
            "database": "INSURANCE",
            "username": user_root,
            "password": password
        }
    }

    Auto_Test004Mysql = {
        'name': 'Auto_Test004Mysql',
        'database_host': test_server004,
        'database_port': '33064',
        'database_name': 'INSURANCE',
        'database_username': user_root,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        "config": {
            "host": test_server004,
            "port": 33064,
            "timezone": "Database Timezone",
            "database": "INSURANCE",
            "username": user_root,
            "password": password
        }
    }


class Oracle:
    database_type = {'database_type': 'Oracle'}
    others = {'thin_type': 'SID'}

    Auto_Test001Oracle = {
        'name': 'Auto_Test001Oracle',
        'database_host': test_server001,
        'database_port': '15212',
        'database_name': 'ORCLCDB',
        'database_owner': 'C##TAPDATA',
        'database_username': 'c##tapdata',
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        **others,
        "config": {
            "thinType": "SERVICE_NAME",
            'database': 'ORCLCDB',
            'host': test_server001,
            'logPluginName': 'logMiner',
            'port': 15212,
            'schema': 'C##TAPDATA',
            'user': 'c##tapdata',
            'password': password
        }
    }
    Auto_Test002Oracle = {
        'name': 'Auto_Test002Oracle',
        'database_host': test_server002,
        'database_port': '15212',
        'database_name': 'ORCLCDB',
        'database_owner': 'C##TAPDATA',
        'database_username': 'c##tapdata',
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        **others,
        "config": {
            "thinType": "SERVICE_NAME",
            'database': 'ORCLCDB',
            'host': test_server002,
            'logPluginName': 'logMiner',
            'port': 15212,
            'schema': 'C##TAPDATA',
            'user': 'c##tapdata',
            'password': password
        }
    }
    Auto_Test003Oracle = {
        'name': 'Auto_Test003Oracle',
        'database_host': test_server003,
        'database_port': '15212',
        'database_name': 'ORCLCDB',
        'database_owner': 'C##TAPDATA',
        'database_username': 'c##tapdata',
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        **others,
        "config": {
            "thinType": "SERVICE_NAME",
            'database': 'ORCLCDB',
            'host': test_server003,
            'logPluginName': 'logMiner',
            'port': 15212,
            'schema': 'C##TAPDATA',
            'user': 'c##tapdata',
            'password': password
        }
    }
    Auto_Test004Oracle = {
        'name': 'Auto_Test004Oracle',
        'database_host': test_server004,
        'database_port': '15212',
        'database_name': 'ORCLCDB',
        'database_owner': 'C##TAPDATA',
        'database_username': 'c##tapdata',
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        **others,
        "config": {
            "thinType": "SERVICE_NAME",
            'database': 'ORCLCDB',
            'host': test_server004,
            'logPluginName': 'logMiner',
            'port': 15212,
            'schema': 'C##TAPDATA',
            'user': 'c##tapdata',
            'password': password
        }
    }
    oracle_122c_TAPDATA = {
        "name": "oracle_122c_TAPDATA",
        **database_type,
        "database_host": "192.168.1.126",
        "database_port": "1521",
        "database_name": "tap122c",
        "database_owner": "TAPDATA",
        "database_username": "TAPDATA",
        "plain_password": "Gotapd8!",
        "connection_type": source_and_target,
        "database_datetype_without_timezone": "+00:00",
        "config": {
            # 'database': 'tap122c',
            'host': '192.168.1.126',
            'logPluginName': 'logMiner',
            'port': 1521,
            'schema': 'TAPDATA',
            'user': 'TAPDATA',
            "password": "Gotapd8!",
            "sid": "tap122c",
            "thinType": "SID",
            'timezone': "",
        }
    }


class MongoDB:
    database_type = {'database_type': 'MongoDB'}
    others = {'additionalString': 'authSource=admin'}

    Auto_Test001MongoDB = {
        'name': 'Auto_Test001MongoDB',
        'database_host': f'{test_server001}:{mongodb_port}',
        'database_port': mongodb_port,
        'database_name': 'source',
        'database_username': user_root,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        **others,
        'config': {
            'uri': f'mongodb://{user_root}:{password}@{test_server001}:{mongodb_port}/source?authSource=admin'
        }
    }

    Auto_Test002MongoDB = {
        'name': 'Auto_Test002MongoDB',
        'database_host': f'{test_server002}:{mongodb_port}',
        'database_port': mongodb_port,
        'database_name': 'source',
        'database_username': user_root,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        **others,
        'config': {
            'uri': f'mongodb://{user_root}:{password}@{test_server002}:{mongodb_port}/source?authSource=admin'
        }
    }
    Auto_Test003MongoDB = {
        'name': 'Auto_Test003MongoDB',
        'database_host': f'{test_server003}:{mongodb_port}',
        'database_port': mongodb_port,
        'database_name': 'source',
        'database_username': user_root,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        **others,
        'config': {
            'uri': f'mongodb://{user_root}:{password}@{test_server003}:{mongodb_port}/source?authSource=admin'
        }
    }
    Auto_Test004MongoDB = {
        'name': 'Auto_Test004MongoDB',
        'database_host': f'{test_server004}:{mongodb_port}',
        'database_port': mongodb_port,
        'database_name': 'source',
        'database_username': user_root,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        **others,
        'config': {
            'uri': f'mongodb://{user_root}:{password}@{test_server004}:{mongodb_port}/source?authSource=admin'
        }
    }
    yun_source = {
        "name": "yun_source",
        **database_type,
        "database_host": "36.134.131.197:27029",
        "database_port": "27029",
        "database_name": "source",
        "database_username": "",
        "plain_password": "",
        'additionalString': 'authSource=admin',
        "connection_type": source_and_target,
        'config': {
            'uri': 'mongodb://36.134.131.197:27029/source?authSource=admin'
        }
    }

    Auto_Test004MongoDB_SOURCE = {
        'name': 'Auto_Test004MongoDB_SOURCE',
        'database_host': f'{test_server004}:{29000}',
        'database_port': 29000,
        'database_name': 'source',
        'database_username': user_root,
        'plain_password': "tapdata",
        **SOURCE_AND_TARGET,
        **database_type,
        **others,
        'config': {
            'uri': f'mongodb://{user_root}:{password}@{test_server004}:{29000}/source?authSource=admin'
        }
    }


class Postgres:
    database_type = 'PostgreSQL'
    others = {
        "thin_type": "SID",
        "pgsql_log_decorder_plugin_name": "wal2json_streaming",
        "additionalString": "autosave=always&cleanupSavePoints=ture",
    }

    Auto_Test001Postgres = {
        'name': 'Auto_Test001Postgres',
        "database_type": database_type,
        'database_host': test_server001,
        'database_port': '5434',
        'database_name': 'TAPDATA',
        'database_owner': 'public',
        'database_username': user_root,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **others,
        "config": {"host": test_server001,
                   "port": 5434,
                   "database": "TAPDATA",
                   "schema": "public",
                   'logPluginName': 'wal2json_rds_streaming',
                   "user": user_root,
                   "password": password}
    }
    Auto_Test002Postgres = {
        'name': 'Auto_Test002Postgres',
        "database_type": database_type,
        'database_host': test_server002,
        'database_port': '5434',
        'database_name': 'TAPDATA',
        'database_owner': 'public',
        'database_username': user_root,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **others,
        "config": {"host": test_server002,
                   "port": 5434,
                   "database": "TAPDATA",
                   'logPluginName': 'wal2json_rds_streaming',
                   "schema": "public",
                   "user": user_root,
                   "password": password}
    }
    Auto_Test003Postgres = {
        'name': 'Auto_Test003Postgres',
        "database_type": database_type,
        'database_host': test_server003,
        'database_port': '5434',
        'database_name': 'TAPDATA',
        'database_owner': 'public',
        'database_username': user_root,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **others,
        "config": {"host": test_server003,
                   "port": 5434,
                   "database": "TAPDATA",
                   'logPluginName': 'wal2json_rds_streaming',
                   "schema": "public",
                   "user": user_root,
                   "password": password}
    }
    Auto_Test004Postgres = {
        'name': 'Auto_Test004Postgres',
        "database_type": database_type,
        'database_host': test_server004,
        'database_port': '5434',
        'database_name': 'TAPDATA',
        'database_owner': 'public',
        'database_username': user_root,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **others,
        "config": {"host": test_server004,
                   "port": 5434,
                   "database": "TAPDATA",
                   'logPluginName': 'wal2json_rds_streaming',
                   "schema": "public",
                   "user": user_root,
                   "password": password}
    }
    postgres_5437 = {
        "name": "postgres_5437",
        "database_type": database_type,
        "database_host": "192.168.1.183",
        "database_port": "5437",
        "database_name": "postgres",
        "database_owner": "public",
        "database_username": "root",
        "plain_password": "Gotapd8#",
        "connection_type": source_and_target,
        **others,
        "config": {"host": "192.168.1.183",
                   "port": 5437,
                   "database": "postgres",
                   "schema": "public",
                   "user": "root",
                   **others,
                   "password": "Gotapd8#"}
    }
    postgres_5437_target = {
        "name": "postgres_5437_target",
        "database_type": database_type,
        "database_host": "192.168.1.183",
        "database_port": "5437",
        "database_name": "target",
        "database_owner": "public",
        "database_username": "root",
        "plain_password": "Gotapd8#",
        "connection_type": source_and_target,
        **others,
        "config": {"host": "192.168.1.183",
                   "port": 5437,
                   "database": "target",
                   "schema": "public",
                   "user": "root",
                   **others,
                   "password": "Gotapd8#"}
    }


class Sqlserver:
    database_type = {'database_type': 'SQL Server'}

    Auto_Test001Sqlserver = {
        'name': 'Auto_Test001Sqlserver',
        'database_host': test_server001,
        'database_port': '1433',
        'database_name': 'master',
        'database_owner': 'dbo',
        'database_username': user_sa,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        "config": {
            'password': password,
            'database': 'master',
            'host': test_server001,
            'port': 1433,
            'schema': 'dbo',
            'timezone': '',
            'user': user_sa,
        }
    }

    Auto_Test001Sqlserver_Source = {
        'name': 'Auto_Test001Sqlserver_Source',
        'database_host': test_server001,
        'database_port': '1433',
        'database_name': 'source',
        'database_owner': 'dbo',
        'database_username': user_sa,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        "config": {
            'password': password,
            'database': 'source',
            'host': test_server001,
            'port': 1433,
            'schema': 'dbo',
            'timezone': '',
            'user': user_sa,
        }
    }

    Auto_Test002Sqlserver = {
        'name': 'Auto_Test002Sqlserver',
        'database_host': test_server002,
        'database_port': '1433',
        'database_name': 'master',
        'database_owner': 'dbo',
        'database_username': user_sa,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        "config": {
            'password': password,
            'database': 'master',
            'host': test_server002,
            'port': 1433,
            'schema': 'dbo',
            'timezone': '',
            'user': user_sa,
        }
    }
    Auto_Test003Sqlserver = {
        'name': 'Auto_Test003Sqlserver',
        'database_host': test_server003,
        'database_port': '1433',
        'database_name': 'master',
        'database_owner': 'dbo',
        'database_username': user_sa,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        "config": {
            'password': password,
            'database': 'master',
            'host': test_server003,
            'port': 1433,
            'schema': 'dbo',
            'timezone': '',
            'user': user_sa,
        }
    }
    Auto_Test004Sqlserver = {
        'name': 'Auto_Test004Sqlserver',
        'database_host': test_server004,
        'database_port': '1433',
        'database_name': 'master',
        'database_owner': 'dbo',
        'database_username': user_sa,
        'plain_password': password,
        **SOURCE_AND_TARGET,
        **database_type,
        "config": {
            'password': password,
            'database': 'master',
            'host': test_server004,
            'port': 1433,
            'schema': 'dbo',
            'timezone': '',
            'user': user_sa,
        }
    }
    sqlserver_2019_source = {
        "name": "sqlserver_2019_source",
        **database_type,
        "database_host": "192.168.1.183",
        "database_port": "11434",
        "database_name": "source",
        "database_owner": "dbo",
        "database_username": "sa",
        "plain_password": "Gotapd8-",
        "connection_type": source_and_target,
        "config": {
            'password': 'Gotapd8-',
            'database': 'source',
            'host': '192.168.1.183',
            'port': 11434,
            'schema': 'dbo',
            'timezone': '',
            'user': 'sa',
        }
    }


class Kafka:
    database_type = {'database_type': 'Kafka'}

    Auto_Test002Kafka = {
        "name": "Auto_Test002Kafka",
        "kafkaBootstrapServers": f'{test_server002}:9092',
        "kafkaPatternTopics": ".",
        "database_username": "",
        "database_password": "",
        "plain_password": "",
        **SOURCE_AND_TARGET,
        **database_type
    }
    Auto_Test004Kafka = {
        "name": "Auto_Test004Kafka",
        "kafkaBootstrapServers": f'{test_server004}:9092',
        "kafkaPatternTopics": ".",
        "database_username": "",
        "database_password": "",
        "plain_password": "",
        **SOURCE_AND_TARGET,
        **database_type
    }
    AUTO_KAFKA_SOURCE = {
        "name": "AUTO_KAFKA_SOURCE",
        **database_type,
        "kafkaBootstrapServers": "192.168.1.183:9093",
        "connection_type": source,
        "kafkaPatternTopics": ".",
        "database_username": "",
        "database_password": "",
        "plain_password": "",
        "config": {
            "kafkaAcks": "-1",
            "kafkaCompressionTyhpe": "gzip",
            "kafkaIgnoreInvalidRecord": False,
            "kafkaIgnorePushError": False,
            "kafkaSalMechanism": "PLAIN",
            "krb5": False,
            "nameSrvAddr": "192.168.1.183:9093"
        },
        'pdk': True
    }

    AUTO_KAFKA_TARGET = {
        "name": "AUTO_KAFKA_TARGET",
        **database_type,
        "kafkaBootstrapServers": "192.168.1.183:9092",
        "connection_type": target,
        "kafkaPatternTopics": ".",
        "database_username": "",
        "database_password": "",
        "plain_password": "",
        "config": {
            "kafkaAcks": "-1",
            "kafkaCompressionTyhpe": "gzip",
            "kafkaIgnoreInvalidRecord": False,
            "kafkaIgnorePushError": False,
            "kafkaSalMechanism": "PLAIN",
            "krb5": False,
            "nameSrvAddr": "192.168.1.183:9092"
        },
        'pdk': True
    }


class ClickHouse:
    database_type = "Clickhouse"

    Auto_Test02ClickHouse = {
        'name': 'Auto_Test02ClickHouse',
        "database_type": database_type,
        'database_host': test_server002,
        'database_port': '8123',
        'python_port': '9000',
        'database_name': 'default',
        'database_username': 'default',
        'plain_password': password,
        **SOURCE_AND_TARGET,
    }

    Auto_Test04ClickHouse = {
        'name': 'Auto_Test04ClickHouse',
        "database_type": database_type,
        'database_host': test_server004,
        'database_port': '8123',
        'python_port': '9000',
        'database_name': 'default',
        'database_username': 'default',
        'plain_password': password,
        **SOURCE_AND_TARGET,
    }

    AUTO_CLICKHOUSE_TARGET = {
        "name": "AUTO_CLICKHOUSE_TARGET",
        "database_type": database_type,
        "database_host": "192.168.1.183",
        'python_port': '9002',
        "database_port": "9123",
        "database_name": "default",
        "database_username": "default",
        "plain_password": "Gotapd8!!",
        "connection_type": target,
        "config": {
            "host": "192.168.1.183",
            "port": 9123,
            "timezone": "",
            "database": "default",
            "user": "default",
            "password": "Gotapd8!!"
        }
    }


class ES:
    database_type = {'database_type': 'Elasticsearch'}
    Auto_Test02ES = {
        'name': 'Auto_Test02ES',
        'database_host': test_server002,
        'database_port': '9204',
        'database_name': '',
        'database_username': '',
        'database_password': '',
        'plain_password': '',
        **TARGET,
        **database_type,
        "config": {
            'host': test_server002,
            'port': 9204,
        }
    }
    Auto_Test04ES = {
        'name': 'Auto_Test04ES',
        'database_host': test_server004,
        'database_port': '9204',
        'database_name': '',
        'database_username': '',
        'database_password': '',
        'plain_password': '',
        **TARGET,
        **database_type,
        "config": {
            'host': test_server004,
            'port': 9204,
        }
    }


class DB2:
    database_type = 'DB2'

    Auto_Test01DB2 = {
        "name": "Auto_Test01DB2",
        "database_type": database_type,
        **SOURCE,
        "database_host": test_server001,
        "database_port": "50000",
        "database_name": "testdb",
        "database_username": "db2inst1",
        "plain_password": "Gotapd8#",
        "database_owner": "testdb",
        "config": {
            'database': 'testdb',
            'host': test_server001,
            'port': 50000,
            'rawLogServerHost': test_server001,
            'rawLogServerPort': 50031,
            'schema': 'testdb',
            'user': 'db2inst1',
            "password": "Gotapd8#"
        }
    }
    AUTO_DB2_SOURCE = {
        "name": "AUTO_DB2_SOURCE",
        "database_type": database_type,
        "connection_type": source,
        "database_host": "192.168.1.132",
        "database_port": "40024",
        "database_name": "TESTDB",
        "database_username": "db2inst1",
        "plain_password": "admin",
        "database_owner": "SOURCE",
        "config": {
            'database': 'TESTDB',
            'host': '192.168.1.132',
            'port': 40024,
            'rawLogServerHost': '192.168.1.132',
            'rawLogServerPort': 50031,
            'schema': 'SOURCE',
            'user': 'db2inst1',
            "password": "admin"
        }
    }

    AUTO_DB2_TARGET = {
        "name": "AUTO_DB2_TARGET",
        "database_type": database_type,
        "connection_type": source,
        "database_host": "192.168.1.132",
        "database_port": "40024",
        "database_name": "TESTDB",
        "database_username": "db2inst1",
        "plain_password": "admin",
        "database_owner": "TARGET",
        "config": {
            'database': 'TESTDB',
            'host': '192.168.1.132',
            'port': 40024,
            'rawLogServerHost': '192.168.1.132',
            'rawLogServerPort': 50031,
            'schema': 'TARGET',
            'user': 'db2inst1',
            "password": "admin"
        }
    }


class OceanBase:
    database_type = 'Oceanbase'
    AUTO_OCEANBASE = {
        "name": "AUTO_OCEANBASE",
        "database_type": database_type,
        "database_host": "192.168.1.189",
        "database_port": "2881",
        "database_name": "target",
        "database_username": "root",
        "plain_password": "rootPWD123",
        "connection_type": target,
        "config": {
            "host": "192.168.1.189",
            "port": 2881,
            "timezone": "",
            "database": "target",
            "user": "root",
            "password": "rootPWD123"
        }
    }


class Doris:
    database_type = 'Doris'

    AUTO_DORIS = {
        "name": "AUTO_DORIS",
        "database_type": database_type,
        "database_host": "192.168.1.183",
        "database_port": "9030",
        "database_name": "target",
        "database_username": "root",
        "plain_password": "",
        "connection_type": target,
        "config": {
            "host": "192.168.1.183",
            "port": 9030,
            "timezone": "",
            "database": "target",
            "username": "root",
            "password": ""
        }
    }


class Dummy:
    database_type = 'Dummy'

    table_fields = [
        {
            'type': 'uuid',
            'pri': True,
            'name': 'pk',
        },
        {
            'type': 'rstring',
            'pri': False,
            'name': 'title',
        },
    ]

    AUTO_DUMMY_SOURCE = {
        "name": "AUTO_DUMMY_SOURCE",
        "database_type": database_type,
        "connection_type": source,
        "config": {
            'incremental_interval': 15000,
            'incremental_interval_totals': 1,
            'incremental_types': [1, 2, 3],
            'initial_totals': 1,
            'table_fields': table_fields,
            'table_name': 'auto_dummy',
            'write_interval': 1000,
            'write_interval_totals': 1,
            'write_log': True
        }
    }

    AUTO_DUMMY_TARGET = {
        "name": "AUTO_DUMMY_TARGET",
        "database_type": database_type,
        "connection_type": target,
        "config": {
            # 'incremental_interval': 1000,
            # 'incremental_interval_totals': 1,
            # 'incremental_types': [1, 2, 3],
            # 'initial_totals': 1,
            # 'table_fields': table_fields,
            # 'table_name': 'auto_dummy',
            'write_interval': 1000,
            'write_interval_totals': 1,
            'write_log': True
        }
    }


class Redis:
    database_type = "Redis"

    AUTO_REDIS_TARGET01 = {
        "name": "AUTO_REDIS_TARGET01",
        "database_type": database_type,
        "database_host": "192.168.1.179",
        "database_port": "6379",
        "database_name": "0",
        "database_username": "",
        "plain_password": "123456",
        "connection_type": target,
        "config": {
            "database": "0",
            'deploymentMode': 'standalone',
            'passwordDisplay': True,
            "host": "192.168.1.179",
            "port": 6379,
            "password": "123456"
        }
    }


class TiDB:
    database_type = "Tidb"

    AUTO_TIDB_SOURCE = {
        "name": "AUTO_TIDB_SOURCE",
        "database_type": database_type,
        "database_host": "192.168.1.183",
        "database_port": "4000",
        "database_name": "source",
        "database_username": "root",
        "plain_password": "",
        "connection_type": source_and_target,
        'tidbPdServer': "http://192.168.1.183:2379",
        'config': {
            'database': 'source',
            'host': '192.168.1.183',
            'pdServer': 'http://192.168.1.183:2379',
            'port': 4000,
            'timezone': '',
            'user': 'root'
        }
    }

    AUTO_TIDB_TARGET = {
        "name": "AUTO_TIDB_TARGET",
        "database_type": database_type,
        "database_host": "192.168.1.183",
        "database_port": "4000",
        "database_name": "target",
        "database_username": "root",
        "plain_password": "",
        "connection_type": source_and_target,
        'tidbPdServer': "http://192.168.1.183:2379",
        'config': {
            'database': 'target',
            'host': '192.168.1.183',
            'pdServer': 'http://192.168.1.183:2379',
            'port': 4000,
            'timezone': '',
            'user': 'root'
        }

    }
